<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	template="/pages/templates/TemplateClient.xhtml">

	<ui:define name="titre">Comme au resto</ui:define>
	<ui:define name="profils">
	<br/>
		<h:form id="formBoutons">
    			<p:commandButton value="Administrateur"
				actionListener="#{connexionMB.switch2Admin}" ajax="true" rendered="#{connexionMB.estAdministrateur}"  />  
    			<p:commandButton value="Restaurateur"
				actionListener="#{connexionMB.switch2Resto}" ajax="true" rendered="#{connexionMB.estRestaurateur}" />  
    			<p:commandButton value="Client"
				actionListener="#{connexionMB.switch2Client}" ajax="true" rendered="#{connexionMB.estClient}"/>  
			</h:form>
	</ui:define>
	<ui:define name="content">
		<h:head></h:head>
		<h:body>
			<h:form id="form">
				<p:growl id="msgs" showDetail="true" />
				<p:dataTable id="restos"  var="r"
					value="#{listeRestaurantMB.listeRestaurants}" sortMode="multiple" >

					<p:column sortBy="#{r.typeCuisine.libelle}" headerText="Type de cuisine" style="width:30%">
						<h:outputText value="#{r.typeCuisine.libelle}" />
					</p:column>
					<p:column sortBy="#{r.nom}" headerText="Restaurants" style="width:60%">
						<h:outputText value="#{r.nom}" />
					</p:column>
					<p:column style="width:30%">
						<p:commandButton id="selectButton"
							action="#{listeRestaurantMB.doSelection}" icon="ui-icon-search"
							title="View">
							<f:setPropertyActionListener value="#{r.id}"
								target="#{listeRestaurantMB.idSelRestaurant}" />
						</p:commandButton>
					</p:column>
				</p:dataTable>
				<br />
			</h:form>
		</h:body>
	</ui:define>
</ui:composition>
